<!-- $Id: agency_info.htm 14216 2008-03-10 02:27:21Z testyang $ -->
<?php echo $this->fetch('pageheader.htm'); ?>
<?php echo $this->smarty_insert_scripts(array('files'=>'validator.js,../js/transport_jquery.js,../js/region.js')); ?>
<script type="text/javascript" src="../js/calendar.php?lang=<?php echo $this->_var['cfg_lang']; ?>"></script>
<link href="../js/calendar/calendar.css" rel="stylesheet" type="text/css" />

<div class="main-div">
<form method="post" action="sheep.php" name="theForm" enctype="multipart/form-data" onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
	<tr>
		<td class="label">当前羊只类型：</td>
		<td>
			<input name="types"  type="radio" value="1" <?php if ($this->_var['sheep']['types'] == 1): ?> checked<?php endif; ?>> 正常购买
			<input name="types"  type="radio" value="2" <?php if ($this->_var['sheep']['types'] == 2): ?> checked<?php endif; ?>> 一元抢
			<input name="types"  type="radio" value="3" <?php if ($this->_var['sheep']['types'] == 3): ?> checked<?php endif; ?>> 我想要
		</td>
	  </tr>
	  <?php if ($this->_var['sheep']['types'] != 1): ?>
  <tr id="jiazhi">
    <td class="label">价值：</td>
    <td><input type="text" name="jiazhi" maxlength="60" value="<?php echo $this->_var['sheep']['jiazhi']; ?>" /></td>
  </tr>
  <?php endif; ?>
	<tr>
    <td class="label">当前期数：</td>
    <td><input type="text" name="qishu" maxlength="60" value="<?php echo $this->_var['sheep']['qishu']; ?>" /><?php echo $this->_var['lang']['require_field']; ?>(填写数字 前台显示第"n"期)</td>
  </tr>
  <tr>
    <td class="label"><?php echo $this->_var['lang']['label_suppliers_name']; ?></td>
    <td><input type="text" name="sheep_name" maxlength="60" value="<?php echo $this->_var['sheep']['sheep_name']; ?>" /><?php echo $this->_var['lang']['require_field']; ?></td>
  </tr>
  <tr>
    <td class="label">品种：</td>
    <td><input type="text" name="sheep_pinzhong" maxlength="60" value="<?php echo $this->_var['sheep']['sheep_pinzhong']; ?>" /><?php echo $this->_var['lang']['require_field']; ?></td>
  </tr>
   <tr>
    <td class="label">羊只图片：</td>
    <td>
	<input type="file" name="logo_img" />
	<input type="hidden" name="logo_imgs" value="<?php echo $this->_var['sheep']['logo_img']; ?>" />
	<?php if ($this->_var['sheep']['logo_img']): ?><img src="/<?php echo $this->_var['sheep']['logo_img']; ?>" width="150px"><?php endif; ?>
	</td>
  </tr>
  	<tr>
    <td class="label">购买价格：</td>
    <td><input type="text" name="price" maxlength="60" value="<?php echo $this->_var['sheep']['price']; ?>" /><?php echo $this->_var['lang']['require_field']; ?></td>
  </tr>
	<tr>
    <td class="label">分红：</td>
    <td><input type="text" name="bonus" maxlength="60" value="<?php echo $this->_var['sheep']['bonus']; ?>" /><?php echo $this->_var['lang']['require_field']; ?>
	(填写百分比 )
	</td>
  </tr>
	<tr>
    <td class="label">领养周期：</td>
    <td><input type="text" name="cycle" maxlength="60" value="<?php echo $this->_var['sheep']['cycle']; ?>" /><?php echo $this->_var['lang']['require_field']; ?>
	(填写数字 按月计算	)
	</td>
  </tr>
	<tr>
    <td class="label">售卖总数：</td>
    <td><input type="text" name="number" maxlength="60" value="<?php echo $this->_var['sheep']['number']; ?>" /><?php echo $this->_var['lang']['require_field']; ?></td>
  </tr>
	<tr id="promote_4">
		<td class="label" >售卖时间</td>
		<td id="promote_6">
		  <input name="start_date" type="text" id="start_date" size="12" value='<?php echo $this->_var['sheep']['start_date']; ?>'  /><input name="selbtn1" type="button" id="selbtn1" onclick="return showCalendar('start_date', '%Y-%m-%d %H:%M', 24, false, 'selbtn1');" value="<?php echo $this->_var['lang']['btn_select']; ?>" class="button"/> 
		  - 
		  <input name="end_date" type="text" id="end_date" size="12" value='<?php echo $this->_var['sheep']['end_date']; ?>'  /><input name="selbtn2" type="button" id="selbtn2" onclick="return showCalendar('end_date', '%Y-%m-%d %H:%M', 24, false, 'selbtn2');" value="<?php echo $this->_var['lang']['btn_select']; ?>" class="button"/>
		</td>
	  </tr>
</table>

<table align="center">
  <tr>
    <td colspan="2" align="center">
      <input type="submit" class="button" value="<?php echo $this->_var['lang']['button_submit']; ?>" />
      <input type="reset" class="button" value="<?php echo $this->_var['lang']['button_reset']; ?>" />
      <input type="hidden" name="act" value="<?php echo $this->_var['form_action']; ?>" />
      <input type="hidden" name="id" value="<?php echo $this->_var['sheep']['sheep_id']; ?>" />
    </td>
  </tr>
</table>
</form>
</div>
<?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,validator.js')); ?>

<script language="JavaScript">
<!--
document.forms['theForm'].elements['qishu'].focus();

onload = function()
{
    // 开始检查订单
    startCheckOrder();
}
/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.required("qishu",  no_qishu);
    validator.required("sheep_name",  no_sheep_name);
    validator.required("price",  no_price);
    validator.required("bonus",  no_bonus);
    validator.required("cycle",  no_cycle);
    validator.required("number",  no_number);
    validator.required("start_date",  no_start_date);
    validator.required("end_date",  no_end_date);
    return validator.passed();
}
//-->

$('input[name=types]').click(function(){
	var val = $(this).val();
	if(val == 1){
		$('#jiazhi').hide();
	}else{
		$('#jiazhi').show();
	}
});
</script>

<?php echo $this->fetch('pagefooter.htm'); ?>